var one=document.querySelector('.one')
    var two=document.querySelector('.two')
    var b=document.querySelector('.b')
    var no=document.querySelector('.no')

    one.onclick=function(){
        
        two.style.display='block'
    }
    b.onclick=function(){
        two.style.display='none'

    }
    no.onclick=function(){
        two.style.display='none'
    }


 
   

   
  





    var input=document.querySelector('.input')
    var text=document.querySelector('.text')

    var yes= document.querySelector('.yes')
    var div=document.querySelector('.nop')

    var time=new Date()

    yes.onclick=function(){
        if(input.value==''||text.value=='')
        {
            alert('输入内容为空')
        }else{
            alert('添加成功')
            
            var op=document.createElement('div')
        
            op.innerHTML=' <span >'+input.value+'</span><br><span >'+time+'</span><br><span >'+text.value+'</span><span class="XX">X</span>'
            op.className='tree'
            div.appendChild(op)    
            var tree = document.querySelectorAll('.tree')

            var XX = document.querySelectorAll('.XX')
            for (var i = 0; i < tree.length; i++) {
                tree[i].onmouseover = function () {
                    this.lastChild.style.display = 'block'
                }
                tree[i].onmouseout = function () {
                    this.lastChild.style.display = 'none'
                }
                XX[i].onclick = function () {
                    div.removeChild(this.parentNode)
                }
            }
        }
    }
   














